home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 February
/
Ahoy_Magazine_87-02_1987_Double_L.d64
/
The Adventurer
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
6KB
|
290 lines
10 rem load screen & title
11 :
20 poke53280,0:poke53281,0
30 print"[147]";
40 printtab(12)"[153]the adventurer"
50 printtab(9)"[150]by jean-francois heon"
60 printtab(11)"joystick in port#2"
70 printtab(13)"please wait..."
80 ifa=0thena=1:load"dj",8,1
99 :
100 rem variables
101 :
110 dim scr(2,3),it(2,3,1),nm(2,3)
120 block=16384:sh=1:mt=1:k=1:s=54272
130 x=7:y=7:x1=0:y1=0:v=2:m=4:man=1
140 fori=0to2:forj=0to3
150 scr(i,j)=v:v=v+1
160 readd:it(i,j,0)=d
170 readd:it(i,j,1)=d
175 readd:nm(i,j)=d
180 next j,i
185 data 12,6,1,4,9,9,8,18,11,32,6,4
190 data 12,3,5,16,12,7,20,9,8,32,12,6
195 data 4,15,3,4,18,10,28,9,12,28,12,2
199 :
200 rem initialition
201 :
210 fori=55295to56255:pokei,9:next
215 forl=stos+24:pokel,0:next
220 poke56578,peek(56578)or3
230 poke56576,(peek(56576)and252)or2
240 poke53272,(peek(53272)and240)or14
250 gosub 6000
260 po=block+1024*scr(y1,x1)+x+y*40
270 co=55296+x+y*40
280 poke po,74:pokeco,1
999 :
1000 rem man moves
1001 :
1005 if man=0thengosub5000:goto7000
1010 j=peek(56320)
1020 if(jand16)=0 then 3000
1030 if(jand1)=0 thenm=1:mv=-40:goto1080
1040 if(jand2)=0 thenm=2:mv=40:goto1080
1050 if(jand4)=0 thenm=3:mv=-1:goto1080
1060 if(jand8)=0 thenm=4:mv=1:goto1080
1070 goto 2000
1080 on m goto 1100,1120,1140,1160
1090 goto 1200
1100 ify-1=-1theny=24:pokepo,32:pokeco,9:y1=y1-1:gosub6000:goto 1200
1110 goto 1170
1120 ify+1=24theny=-1:pokepo,32:pokeco,9:y1=y1+1:gosub6000:goto 1200
1130 goto 1170
1140 ifx-1=-1thenx=40:pokepo,32:pokeco,9:x1=x1-1:gosub6000:goto 1200
1150 goto 1170
1160 ifx+1=40thenx=-1:pokepo,32:pokeco,9:x1=x1+1:gosub6000:goto 1200
1170 if peek(po+mv)>64andpeek(po+mv)<70 then2000
1180 if peek(po+mv)=76 and k=nm(y1,x1)then gosub 4500:goto 1200
1190 if peek(po+mv)=76 then gosub4520:goto2000
1195 if peek(po+mv)>76andpeek(po+mv)<80 then gosub5000:goto7000
1200 on m gosub 1220,1230,1240,1250
1210 goto 1260
1220 y=y-1:return
1230 y=y+1:return
1240 x=x-1:return
1250 x=x+1:return
1260 pq=po:cq=co
1270 po=block+1024*scr(y1,x1)+x+y*40
1280 co=55296+x+y*40
1290 poke co,1
1300 on m gosub 1330,1330,1350,1370
1310 poke pq,32:poke cq,9:gosub 4000
1320 goto 2000
1330 poke po,71+sh:sh=sh+1:ifsh=3thensh=1
1340 return
1350 poke po,69+sh:sh=sh+1:ifsh=3thensh=1
1360 return
1370 poke po,73+sh:sh=sh+1:ifsh=3thensh=1
1380 return
1999 :
2000 rem monster moves
2001 :
2010 mv=0
2020 if mt=0 then 2500
2030 if x<a then mm=1:mv=-1:goto2070
2040 if x>a then mm=2:mv=1:goto2070
2050 if y<b then mm=3:mv=-40:goto2070
2060 if y>b then mm=4:mv=40
2070 if peek(pm+mv)>64 and peek(pm+mv)<70 then 1000
2080 if peek(pm+mv)>69 and peek(pm+mv)<76 then man=0
2090 if peek(pm+mv)=76 then 1000
2100 on mm gosub 2120,2130,2140,2150
2110 goto 2160
2120 a=a-1:return
2130 a=a+1:return
2140 b=b-1:return
2150 b=b+1:return
2160 pw=pm:cw=cm
2170 pm=block+1024*scr(y1,x1)+a+b*40
2180 cm=55296+a+b*40
2190 poke cm,13
2200 poke pm,76+mt:mt=mt+1:ifmt=4thenmt=1
2210 poke pw,32:poke cw,9
2220 goto 2500
2499 :
2500 rem score & key sub-routine
2501 :
2510 print"";
2520 print"[158]score:"sctab(20)"[153]key number:"k""
2530 goto 1000
2999 :
3000 rem shoot routine
3001 :
3005 gosub 3600:rem sound
3010 on m goto 3020,3100,3180,3260
3020 if y=0 then 2000
3030 d=y-5:ifd<0thend=0
3040 for i=y-1 to d step-1
3050 if i<y-1 then pe=pt:ce=ct
3060 pt=block+1024*scr(y1,x1)+x+i*40
3070 ct=55296+x+i*40
3080 goto 3500
3090 :
3100 if y=23 then 2000
3110 d=y+5:ifd>23thend=23
3120 for i=y+1 to d
3130 if i>y+1 then pe=pt:ce=ct
3140 pt=block+1024*scr(y1,x1)+x+i*40
3150 ct=55296+x+i*40
3160 goto 3500
3170 :
3180 if x=0 then 2000
3190 d=x-5:ifd<0thend=0
3200 for i=x-1 to d step-1
3210 if i<x-1 then pe=pt:ce=ct
3220 pt=block+1024*scr(y1,x1)+i+y*40
3230 ct=55296+i+y*40
3240 goto 3500
3250 :
3260 if x=39 then 2000
3270 d=x+5:ifd>39thend=39
3280 for i=x+1 to d
3290 if i>x+1 then pe=pt:ce=ct
3300 pt=block+1024*scr(y1,x1)+i+y*40
3310 ct=55296+i+y*40
3320 goto 3500
3330 :
3500 if peek(pt)>64 and peek(pt)<70 theni=d:goto 3560
3510 if peek(pt)>76 and peek(pt)<80 and mt<>0 theni=d:mt=0:sc=sc+50:goto 3530
3520 if peek(pt)=76 then i=d:goto 3560
3530 poke pt,79+m:poke ct,15
3540 fort=0to50:next
3550 poke pe,32:poke ce,9
3560 next:if peek(pe)>79 then poke pe,32:poke ce,9
3570 if peek(pt)>79 then poke pt,32:poke ct,9
3580 pokes+4,128:pokes+24,0:goto 2000
3600 pokes+24,15
3610 pokes+5,15:pokes+6,255
3620 pokes+1,30:pokes,0
3630 pokes+4,129
3640 return
3999 :
4000 rem man sound sub-routine
4001 :
4010 pokes+5,0:pokes+6,15
4020 pokes+24,15
4030 pokes+1,30:pokes,0
4040 pokes+4,129
4050 pokes+4,128
4060 pokes+24,0
4070 return
4499 :
4500 rem key sound sub-routine
4501 :
4510 k=k+1:sc=sc+100:nm(y1,x1)=0
4520 pokes+5,15:pokes+6,255
4530 pokes+24,15
4540 pokes+1,244:pokes,103
4550 pokes+4,17
4560 fort=1to7:pokes+24,15-t*2
4570 fori=1to250:nexti,t
4580 pokes+4,16
4590 pokes+24,0
4600 return
4999 :
5000 rem dead sound sub-routine
5001 :
5005 s=54272
5010 pokes+5,244:pokes+6,103
5020 pokes+24,15
5030 pokes+1,244:pokes,0
5040 pokes+4,129
5050 fori=1to7000:next
5060 pokes+4,128
5100 pokes+24,0
5110 return
5999 :
6000 rem ghange screen sub-routine
6001 :
6005 poke px,32:poke cx,9:poke pm,32:poke cm,9:mt=1
6010 poke53272,(peek(53272)and15)orscr(y1,x1)*16
6020 v=block+1024*scr(y1,x1)
6030 poke 648,int(v/256)
6032 print" ";
6033 ifx1=0andy1=0andk=13 then 8000
6034 ifk=13 then 6070
6035 if nm(y1,x1)=0 then mt=0:return
6040 px=block+1024*scr(y1,x1)+it(y1,x1,0)+it(y1,x1,1)*40
6050 cx=55296+it(y1,x1,0)+it(y1,x1,1)*40
6060 poke px,76:pokecx,1
6070 a=it(y1,x1,0)+1:b=it(y1,x1,1)+1
6080 pm=block+1024*scr(y1,x1)+a+b*40
6090 cm=55296+a+b*40
6100 poke pm,77:pokecm,13
6110 return
6999 :
7000 rem game over
7001 :
7005 pokepo,32:pokepx,32:pokepm,32
7010 poke56578,peek(56578)or3
7020 poke56576,(peek(56576)and252)or3
7030 poke53272,(peek(53272)and240)or4
7040 poke53272,(peek(53272)and15)or16
7050 poke 648,4
7060 print"[147]";
7070 printtab(14)"game over"
7080 printtab(5)"(press a key for a new game)"
7090 geta$:ifa$=""then7090
7100 printtab(5)"[145] "
7110 clr:restore:goto 100
7999 :
8000 rem you won!
8001 :
8010 poke56578,peek(56578)or3
8020 poke56576,(peek(56576)and252)or3
8030 poke53272,(peek(53272)and240)or4
8040 poke53272,(peek(53272)and15)or16
8050 poke 648,4
8060 print"[147]";
8070 print"you are opening the door..."
8080 gosub 4500
8090 print"[147]";
8130 printtab(16)"[155][169] [223]"
8140 printtab(16)"[152] "
8150 printtab(16)"[152] "
8160 printtab(15)"[155][169] [223]"
8170 printtab(15)"[152] "
8180 printtab(15)"[152] "
8190 printtab(14)"[155][169] [223]"
8200 printtab(14)"[152] "
8210 printtab(14)"[152] "
8220 printtab(13)"[155][169] [223]"
8230 printtab(13)"[152] "
8240 printtab(13)"[152] "
8250 printtab(12)"[155][169] [223]"
8260 printtab(12)"[152] "
8270 printtab(12)"[152] "
8280 printtab(11)"[155][169] [223]"
8290 printtab(11)"[152] "
8300 printtab(11)"[152] "
8310 printtab(10)"[155][169] [223]"
8320 printtab(10)"[152] "
8330 printtab(10)"[152] "
8335 printtab(9)"[155][169] you're escaping [223]";
8340 x$=" [157][157][157][157]"
8350 a$=x$+x$+x$
8360 x$=" [157][157][157][157][157][157]"
8370 b$=x$+x$+x$+x$+x$
8380 x$=" [157][157][157][157][157][157][157][157]"
8390 c$=x$+x$+x$+x$+x$+x$
8400 x$=" [157][157][157][157][157][157][157][157][157][157]"
8410 d$=x$+x$+x$+x$+x$+x$+x$
8420 x$=" [157][157][157][157][157][157][157][157][157][157][157][157]"
8423 y$=" the [157][157][157][157][157][157][157][157][157][157][157][157]"
8425 z$=" end [157][157][157][157][157][157][157][157][157][157][157][157]"
8430 e$=x$+x$+x$+y$+z$+x$+x$+x$
8480 a=17:b=16:c=15:d=14:e=13:f=12:g=11:poke646,14
8490 x=a:y=0:gosub 9000:print""a$:gosub9000:gosub9020:gosub4000:print"[146]"a$
8500 x=b:y=1:gosub 9000:print""b$:gosub9000:gosub9020:gosub4000:print"[146]"b$
8510 x=c:y=3:gosub 9000:print""c$:gosub9000:gosub9020:gosub4000:print"[146]"c$
8520 x=d:y=5:gosub 9000:print""d$:gosub9000:gosub9020:gosub5000
8525 gosub9000:gosub9020:gosub4000:print"[146]"d$
8530 x=e:y=7:gosub 9000:print""e$
8560 x=0:y=24:gosub9000
8570 printtab(9)"[155][169] maybe... [223]";
8580 goto8580
9000 poke782,x:poke781,y:sys 65520
9010 return
9020 fori=1to1000:next:return